package manager;


import builder.RequestBuilder;

import Interceptor.RequestInterceptor;
import Interceptor.ResponseInterceptor;
import SyncPool.URLConfig;

import connection.HttpRequest;

public final class ConnectionManager {
	private HttpRequest httpRequest;
	
	private RequestBuilder requestBuilder;
	
	
	
	

	public ConnectionManager(URLConfig config, HttpRequest httpRequest) {
		this.httpRequest = httpRequest;
		requestBuilder = new RequestBuilder().config(config);
	}

	public final void SendPost() {

		httpRequest.sendPost(requestBuilder);

	}

	public final void SendGet() {
		httpRequest.sendGet(requestBuilder);
	}

	public void stop() {
		httpRequest.stop();
	}

	public void cancle() {
		httpRequest.cancle();
	}

	public void addRequestInterceptor(RequestInterceptor requestInterceptor) {
		// TODO Auto-generated method stub
		httpRequest.addRequestInterceptor(requestInterceptor);
	}

	
	public  void  addResponseInterceptor(ResponseInterceptor responseInterceptor){
		httpRequest.addResponseInterceptors(responseInterceptor);
	}
	
	
	
	
	public HttpRequest getHttpRequest() {
		return httpRequest;
	}

	public RequestBuilder getRequestBuilder() {
		return requestBuilder;
	}

	
	
	
	
}
